/**
 * 文 件 名：BookService.java
 * CopyRight (c) 2013 Anze, Inc. All rights reserved.
 * 创 建 人：lurf
 * 日      期：2013-9-18 下午3:20:58
 * 描      述：
 */
package com.anze.abd.service.book;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.anze.abd.persistence.dao.BookDao;
import com.anze.abd.persistence.domain.Book;
import com.anze.base.service.commons.BaseService;

/**
 * 描述：图书管理
 * @author lurf 2013-9-18
 * @version 2.0.0
 * @since 2.0.0
 */
@Service("bookService")
public class BookService extends BaseService {
	
	@Resource(name = "bookDao")
	private BookDao bookDao;

	/**
	 * 描述：保存新增
	 * @param book
	 * @author lurf 2013-9-22
	 * @version 2.0.0
	 * @since 2.0.0
	 */
	public void save(Book book) {
		bookDao.save(book);
	}

	/**
	 * 描述：保存更新
	 * @param book
	 * @author lurf 2013-9-22
	 * @version 2.0.0
	 * @since 2.0.0
	 */
	public void update(Book book) {
		bookDao.update(book);
	}

	/**
	 * 描述：删除图书
	 * @param id
	 * @author lurf 2013-9-22
	 * @version 2.0.0
	 * @since 2.0.0
	 */
	public void delete(Long id) {
		Book book = bookDao.get(id);
		bookDao.delete(book);
	}

	/**
	 * 描述：获取图书
	 * @param id
	 * @return
	 * @author lurf 2013-9-22
	 * @version 2.0.0
	 * @since 2.0.0
	 */
	public Book get(Long id) {
		return bookDao.get(id);
	}

}
